<?php

namespace app\admin\service\login;

use app\common\model\addons\Addons as AddonsModel;
use think\facade\Db;
use think\facade\Event;
use tmcore\base\BaseService;

/**
 * 配置类服务类
 */
class ConfigService extends BaseService
{
    /**
     * 获取配置
     * @return array
     */
    public static function getConfig(): array
    {
        $web_config = com_get_config('website','core');
        $base_config = com_get_config( 'base','sys');
        return [
            'loginConfig' => [],
            'sysConfig' => [
                // 网站名称
                'web_name' => empty($base_config['name'])?$web_config['name']:$base_config['name'],
                // 网站图标
                'web_favicon' => empty($base_config['web_favicon'])?get_file_url($web_config['web_favicon']):get_file_url($base_config['web_favicon']),
                // 网站logo
                'web_logo' => empty($base_config['web_logo'])?get_file_url($web_config['web_logo']):get_file_url($base_config['web_logo']),
                // workerman 路径
                'workerman_terminal_status' => cache('workerman_terminal_status')?1:0,
            ]
        ];
    }
}